Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


Compositional (version 5.0)

Multivariate normal random values simulation on the simplex: Multivariate normal random values simulation on the simplex

Description

Multivariate normal random values simulation on the simplex.

Usage

rcompnorm(n, m, s, type = "alr")

Arguments

n

The sample size, a numerical value.

m

The mean vector in Rd.

s

The covariance matrix in Rd.

type

The alr (type = "alr") or the ilr (type = "ilr") is to be used for closing the Euclidean data onto the simplex.

Value

A matrix with the simulated data.

Details

The algorithm is straightforward, generate random values from a multivariate normal distribution in Rd and brings the values to the simplex Sd using the inverse of a log-ratio transformation.

References

Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.

See Also

comp.den, rdiri, rcompt, rcompsn

Examples

Run this code
# NOT RUN {
x <- as.matrix(iris[, 1:2])
m <- colMeans(x)
s <- var(x)
y <- rcompnorm(100, m, s)
comp.den(y)
ternary(y)
# }

Run the code above in your browser using DataLab